<!-- --------- 实名认证----------- -->
<template>
	<view class="smrz">
		<view class="tips">
			<text>为了您的资金安全，需验证您的身份才可以进行其他操作；</text>
			<text>认证信息一经验证不能修改，请如实填写。</text>
		</view>
		<view class="inputContent">
			<view class="list">
				<view class="leftText">姓名</view>
				<input
					:disabled="disabled"
					type="text"
					v-model="name"
					placeholder="请填写你的真实姓名"
					placeholder-class="pl"
				/>
			</view>
			<view class="list" :style="{ border: `none` }">
				<view class="leftText">身份证号码</view>
				<input
					:disabled="disabled"
					type="idcard"
					v-model="idNumber"
					placeholder="请填写你的身份证号码"
					placeholder-class="pl"
				/>
			</view>
		</view>
		<button :disabled="disabled" @click="submit" class="submit">提交</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: "",
				idNumber: "",
				disabled: false,
			};
		},
		onLoad() {
			this.$request.get("/Home/info/me").then(({ data }) => {
				data.ue_truename && data.idcard && (this.disabled = true);

				this.name = data.ue_truename;
				this.idNumber = data.idcard;
			});
		},
		methods: {
			submit() {
				this.$request
					.get("/Home/info/zlxg", {
						nickname: this.name,
						idcard: this.idNumber,
					})
					.then(({ msg: title }) => {
						uni.showToast({
							title,
							success: () => setTimeout(uni.navigateBack, 1500),
						});
					});
			},
		},
	};
</script>

<style lang="scss">
	.smrz {
		padding: 30rpx;
		box-sizing: border-box;

		.tips {
			display: flex;
			flex-direction: column;
			font-size: 24rpx;
			line-height: 2;
			font-family: Alibaba PuHuiTi;
			color: #999;
			margin-bottom: 30rpx;
		}

		.inputContent {
			border-radius: 10rpx;
			background: #ffffff;
			padding: 0 20rpx;
			margin-bottom: 150rpx;
			.list {
				display: flex;
				flex-direction: row;
				align-items: center;
				border-bottom: 1rpx solid #e5e5e5;
				height: 98rpx;

				.leftText {
					width: 200rpx;
					font-size: 30rpx;
					font-family: Alibaba PuHuiTi;
					font-weight: 400;
					color: #1a1a1a;
					margin-right: 10rpx;
				}

				input {
					flex-grow: 1;
				}

				.pl {
					font-size: 24rpx;
					font-family: Alibaba PuHuiTi;
					font-weight: 400;
					color: #999999;
				}
			}
		}

		.submit {
			width: 100%;
			height: 80rpx;
			background: #2a62ff;
			border-radius: 10rpx;
			font-size: 34rpx;
			font-family: Alibaba PuHuiTi;
			font-weight: 400;
			color: #ffffff;
			line-height: 80rpx;
			text-align: center;
		}
	}
</style>
